﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace TTData
{
    /// <summary>
    /// The carriage card object
    /// </summary>
    public class CarrigeCard
    {
        private Int32 _value, _points;
        private String _source;

        /// <summary>
        /// Creates a new Carriage Card
        /// </summary>
        /// <param name="value">the number of vagons</param>
        /// <param name="points">the number of points the card is worth</param>
        public CarrigeCard(Int32 value, Int32 points)
        {
            _value = value;
            _points = points;            
        }

        public const String IMAGE_POSTAL_BLUE = "resources/images/carriges/sediu_blue.gif";
        public const String IMAGE_POSTAL_RED = "resources/images/carriges/sediu_red.gif";
        public const String IMAGE_POSTAL_YELLOW = "resources/images/carriges/sediu_yellow.gif";
        public const String IMAGE_POSTAL_GREEN = "resources/images/carriges/sediu_green.gif";


        /// <summary>
        /// Set or get the carrige card's number of vagons
        /// </summary>
        public Int32 Value
        {
            get
            {
                return _value;
            }
            set
            {
                _value = value;
            }
        }

        /// <summary>
        /// Set or get the carrige card's number of points
        /// </summary>
        public Int32 Points
        {
            get
            {
                return _points;
            }
            set
            {
                _points = value;
            }
        }

        public String Source
        {
            get
            {
                if (_value < 3)
                    return _source;
                else
                {
                    if (_value == 3)
                        return "resources/images/carriges/vagons_3.gif";
                    else if (_value == 4)
                        return "resources/images/carriges/vagons_4.gif";
                    else if (_value == 5)
                        return "resources/images/carriges/vagons_5.gif";
                    else if (_value == 6)
                        return "resources/images/carriges/vagons_6.gif";
                    else if (_value == 7)
                        return "resources/images/carriges/vagons_7.gif";
                }
                return _source;
            }
            set
            {
                _source = value;
            }
        }
    }
}
